<template>
    <div  class="bg">
        <div class="title">
        五台山旅游数据管理后台
        </div>

        <div class="login">
        <el-input v-model="username"  placeholder="请输入用户名"></el-input>
        <el-input placeholder="请输入密码" v-model="pwd" show-password></el-input>
        <el-button type="primary" round @click="goLogin">登录</el-button>
        </div>
        
    </div>
</template>

<script>
    export default {
 
        data() {
            return {
                username: '',
                pwd:'',
                data:''
        }
    },
   
    methods: {
        goLogin() {
            console.log(this.username,this.pwd);
           const url = "/ht_login"
           const params =`admin_name=${this.username}&&admin_pwd=${this.pwd}`
           this.axios.post(url,params).then((res)=>{
            // this.data=res.data.result
       
            this.data=res.data.result[0].admin_name
            if(res.data.code==200){
             this.$store.commit('getadmin',this.data)
                this.$router.push('/wts/data')
            }
           })
            
        }
    },
}
    
</script>

<style scoped lang="scss">
.bg{
    position: relative;
    height: 100vh;
    width:100vw;
    background-image: url('/src/assets/thumb-1920-692667.jpg');
    background-repeat: no-repeat;
    background-position: 100% 100%;
    background-attachment: fixed; 
    background-size: cover;
   
  }
.title {
    position:relative;
    text-align: center;
    top: 200px;
    font-size: 40px;
    
}

.el-input {
    position:relative;
    width: 550px;
    display: flex;
    margin: 30px auto;
    top: 220px;
  height: 50px;

}
.el-input__inner {
    height: 55px !important;
    font-size: 18px;
}

.el-button {
    position:relative;
  width: 500px;
  height: 50px;
    display: flex;
    top: 250px;
    margin: 30px auto;
    font-size: 20px; 
}
</style>